﻿<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" default-lazy="true" namespace="Cms.Domain" assembly="Cms.Domain">
  <class name="UserGroup" table="cmsUserGroup">
    <cache usage="read-write" />
    <id name="ID" type="System.Int32" unsaved-value="0">
      <column name="ID" />
      <generator class="identity" />
    </id>
    <property name="Name" type="System.String">
      <column name="Name" not-null="true" />
    </property>
    <bag name="Memberships" table="cmsMembership" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="UserGroupID" />
      </key>
      <one-to-many class="Membership" />
    </bag>
    <bag name="Fields" table="cmsUserGroupField" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="UserGroupId" />
      </key>
      <one-to-many class="UserGroupField" />
    </bag>
    <bag inverse="true" name="SelectedPages" table="cmsPageRequiredUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="Page">
        <column name="PageID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="DeselectedPages" table="cmsPageDeselectedUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="Page">
        <column name="PageID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="SelectedFolders" table="cmsFolderRequiredUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="Folder">
        <column name="FolderID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="DeselectedFolders" table="cmsFolderDeselectedUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="Folder">
        <column name="FolderID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="SelectedMediaFolders" table="cmsMediaFolderRequiredUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="MediaFolder">
        <column name="FolderID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="DeselectedMediaFolders" table="cmsMediaFolderDeselectedUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="MediaFolder">
        <column name="FolderID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="SelectedMediaFiles" table="cmsMediaFileRequiredUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="MediaFile">
        <column name="FileID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="DeselectedMediaFiles" table="cmsMediaFileDeselectedUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="MediaFile">
        <column name="FileID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="SelectedContent" table="cmsContentRequiredUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="Content">
        <column name="ContentID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="DeselectedContent" table="cmsContentDeselectedUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="Content">
        <column name="ContentID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="SelectedRssFeeds" table="cmsRssFeedRequiredUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="RssFeed">
        <column name="RssFeedID" />
      </many-to-many>
    </bag>
    <many-to-one name="LoginPage" column="LoginPageID" not-null="false" />
    <many-to-one name="StartPage" column="StartPageID" not-null="false" />
  </class>
</hibernate-mapping>